// 无需权限的固定路由
export const staticRoutes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: { hidden: true }
  },
  {
    path: '/404',
    component: () => import('@/views/error/404.vue'),
    hidden: true
  },
  {
    path: '/',
    component: () => import('@/layouts/index.vue'),
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/index.vue'),
        meta: { title: '控制台', icon: 'dashboard', affix: true }
      }
    ]
  },
  // 404页面必须最后注册
  { path: '/:pathMatch(.*)*', redirect: '/404', hidden: true }
]

// // 需要动态加载的权限路由（示例）
export const authRoutes = [
  {
    path: '/',
    component: () => import('@/layouts/index.vue'),
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/index.vue'),
        meta: { title: '控制台', icon: 'dashboard', affix: true }
      },
      // 更多权限路由...
      {
        path: 'book',
        name: 'Book',
        meta: { title: '图书管理', icon: 'book' },
        children: [
          {
            path: 'booklist',
            name: 'BookList',
            meta: { title: '图书列表', icon: 'book' },
            component: () => import('@/views/book/booklist.vue'),

          },
        ]
      }
    ]
  }
]
